/*
 * @Descripttion:
 * @version: 1.0.0
 * @Author: lai_hq@qq.com
 * @Date: 2022-07-30 11:48:40
 * @LastEditors: lai_hq@qq.com
 * @LastEditTime: 2022-08-05 17:06:40
 */
import 'ant-design-vue/es/message/style/css'
import 'ant-design-vue/es/Modal/style/css'
import 'animate.css/animate.min.css'

import { createApp } from 'vue'
import * as Sentry from '@sentry/vue'
import { BrowserTracing } from '@sentry/tracing'

import * as Icons from '@ant-design/icons-vue'
import App from './App.vue'

import router from '@/router'

import store from '@/store'

import Czc from '@/core/czc'

const app = createApp(App)

Czc.init({
    siteId: 1281146503,
    environment: ['production']
})

if (import.meta.env.MODE === 'production') {
    Sentry.init({
        app,
        dsn: 'https://338950d8aa6d40ebb657d146f474f250@sentry.yyide.com/8',
        release: '1.0.0',
        integrations: [
            new BrowserTracing({
                routingInstrumentation: Sentry.vueRouterInstrumentation(router),
                tracingOrigins: ['localhost', 'https://cloud.yyide.com', /^\//]
            })
        ],
        tracesSampleRate: 1.0,
        logErrors: false
    })
}

const icons: { [x: string]: any } = Icons
// eslint-disable-next-line no-restricted-syntax, guard-for-in
for (const i in icons) {
    app.component(i, icons[i])
}

app.use(router).use(store).mount('#app')
